package com.indexingsystem.system.service;

import java.util.List;

import com.indexingsystem.boss.Vo.IprulesVo;
import com.indexingsystem.boss.Vo.TreeQueryVo;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.Iprules;

public interface IIprulesService {

	int deleteByPrimaryKey(String ipRuleId) throws Exception;

	/**
	 * 获取ip规则总记录数.
	 * 
	 * @return
	 */
	Integer getIpRulesCount(TreeQueryVo treeQueryVo);

	/**
	 * 获取最上级机构列表总数量.
	 * 
	 * @return
	 */
	Integer getFirstIpRulesCount();

	int deleteIprulesByIdBatch(List<String> ipRuleIdList) throws Exception;

	int insertSelective(Iprules record) throws Exception;

	PagedResult<IprulesVo> selectIprulesList(TreeQueryVo treeQueryVo);

	/**
	 * 获取最上级机构列表.
	 * 
	 * @param treeQueryVo
	 * @return
	 */
	PagedResult<IprulesVo> getFirstIprulesList(TreeQueryVo treeQueryVo);

	IprulesVo selectByPrimaryKey(String ipRuleId);

	Iprules selectByRuleName(String ruleName);

	int updateByPrimaryKeySelective(Iprules record) throws Exception;
	
	/**
	 * 通过机构id校验规则名称、机构ip段是否重复.
	 * @param institutionsId
	 * @return
	 */
	List<IprulesVo> queryIprulesByInstitutionsId(String institutionsId);
	
	/**
	 * 根据机构Id查询ip信息
	 * @param ipRuleId
	 * @return
	 */
	Iprules selectByPrimaryIprulesId(String ipRuleId);
	
	
	/**
	 * 通过机构id获取机构所属ip规则列表.
	 * @param institutionsId
	 * @return
	 */
	List<Iprules> getIprulesList(String institutionsId);
}